
abstract class Shape{
    public abstract void draw();
}

public class Rect extends Shape {
    @Override
    public void draw() {
        System.out.println("画矩形");
    }
}
class Cycle extends Shape{

    @Override
    public void draw() {
        System.out.println("⚪");
    }
}
class Flower extends Shape{

    @Override
    public void draw() {
        System.out.println("❀");
    }
}
 class Print{
    public static void drawMap(Shape shape){
        shape.draw();
    }
     public static void main(String[] args) {
         Rect rect = new Rect();
         Cycle cycle = new Cycle();
         Flower flower = new Flower();
         drawMap(rect);
         drawMap(cycle);
         drawMap(flower);
         System.out.println("------------------------------");
         Shape[] shapes = {rect,cycle,flower};
         for (Shape shape : shapes){
             shape.draw();
         }
     }
 }